package com.crois.barrier.common.exception;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * @author Hou Ze Yu
 * @description
 * @date 2020/7/10
 */
@AllArgsConstructor
@NoArgsConstructor
@Getter
public enum BarrierExceptionEnum {
    BARRIER_GATEWAY_LOG_STATISTICS_ADD_FAIL("网关异常，添加统计信息失败!",547),
    BARRIER_GATEWAY_LOG_SEND_ADD_FAIL("网关异常，添加日志信息失败!",546),
    BARRIER_GATEWAY_IP_BLACK_WHITE_DELETE_FAIL("网关异常，删除黑白名单失败!",545),
    BARRIER_GATEWAY_IP_BLACK_WHITE_UPDATE_FAIL("网关异常，修改黑白名单失败!",544),
    BARRIER_GATEWAY_IP_BLACK_WHITE_ADD_FAIL("网关异常，添加黑白名单失败!",543),
    BARRIER_GATEWAY_IP_BLACK_WHITE_SYNC_FAIL("网关异常，ip黑白名单同步失败!",542),
    BARRIER_GATEWAY_IP_BLACK_FAIL("网关异常，ip被限制!",541),
    BARRIER_GATEWAY_PLUGIN_UPDATE_FAIL("网关异常，修改插件失败!",540),
    BARRIER_GATEWAY_PLUGIN_SYNC_FAIL("网关异常，插件同步失败!",539),
    BARRIER_GATEWAY_ROUTE_SYNC_FAIL("网关异常，路由同步失败!",538),
    BARRIER_GATEWAY_ROUTE_UPDATE_FAIL("网关异常，修改路由失败!",537),
    BARRIER_GATEWAY_ROUTE_ADD_FAIL("网关异常，添加路由失败!",536),
    BARRIER_GATEWAY_NOT_DOING_SERVER_NAME_FAIL("网关异常，无可用服务名称",535),
    BARRIER_GATEWAY_NOT_DOING_SERVER_FAIL("网关异常，无可用服务端",534),
    BARRIER_GATEWAY_NOT_ENV_FAIL( "网关请求失败!,没有指定API环境!",533),
    BARRIER_GATEWAY_APP_AUTH_ADD_FAIL( "网关应用授权添加失败!",531),
    BARRIER_GATEWAY_PLUGIN_ADD_FAIL( "网关插件添加失败!",530),
    BARRIER_GATEWAY_PLUGIN_NAME_EXIST( "插件名称已存在!",529),
    BARRIER_GATEWAY_APP_NAME_NOT_EXIST( "应用名称已经存在!",528),
    BARRIER_GATEWAY_APP_NAME_EXIST( "应用名称已经存在!",527),
    BARRIER_GATEWAY_SIGN_IS_NOT_PASS( "签名未通过!",401),
    BARRIER_GATEWAY_BEFORE_PLUGIN_FAIL("网关BEFORE插件异常",510),
    BARRIER_GATEWAY_ROUTE_PLUGIN_FAIL("网关ROUTE插件异常",510),
    BARRIER_GATEWAY_AFTER_PLUGIN_FAIL("网关AFTER插件异常",511),
    BARRIER_GATEWAY_FAIL("网关请求异常",512),
    BARRIER_GATEWAY_NOT_FIND_AVAILABLE_URL("当前环境网关没有发现可用URL!",521),
    BARRIER_GATEWAY_SERVICE_RESULT_ERROR( "服务调用异常，或者未返回结果",522),
    BARRIER_GATEWAY_SERVICE_TIMEOUT("网关服务调用超时",523),
    BARRIER_GATEWAY_TIMEOUT_FAIL("网关转发超时",524),
    BARRIER_GATEWAY_FILE_MAX_SIZE("上传文件过大！",525),
    BARRIER_GATEWAY_SING_TIME_IS_TIMEOUT("签名时间戳已经超过%s分钟!",526),
    BARRIER_GATEWAY_ENV_FAIL("请传入正确的环境参数!",528),
    BARRIER_GATEWAY_ROUTE_NOT_MATCH("网关未匹配到可用ROUTE",527),
    NOT_AUTH("无权限操作",4011);
    private String message;
    private int code;
}
